/**
 * Created by LMN on 2017/1/11.
 */
//确认窗
var confirmed = null,uncertainty = null;
function confirmOut(msg, confirm, cancel){
    var mod = $('#my-confirm');
    $('#my-confirm-content').text(msg);
    mod.modal();
    mod.find('button[name="focus"]').focus();
    if(confirm) confirmed = function () {
        mod.modal('hide');
        confirm();
    };
    else confirmed = function () {};
    if(cancel) uncertainty = function () {
        mod.modal('hide');
        cancel();
    };
    else uncertainty = function () {};
}
function erroralert(msg){
    var mod = $('#my-alert');
    var loginA = $('#my-login-a');
    loginA.hide();
    $('#my-alert-title').text('错误！');
    $('#my-alert-content').text(msg);
    if(msg=='未登录'){
        loginA.show();
    }
    mod.modal();
    mod.find('button[name="focus"]').focus();
}
function errordelay(msg,callback){
    var mod = $('#my-alert');
    $('#my-alert-title').text('错误！');
    $('#my-alert-content').text(msg);
    mod.modal();
    mod.find('button[name="focus"]').focus();
    setTimeout(function(){
        mod.modal('hide');
        if(callback) callback();
    },1000);
}
function messagedelay(msg,callback){
    var mod = $('#my-alert');
    var loginA = $('#my-login-a');
    loginA.hide();
    $('#my-alert-title').text('消息:');
    $('#my-alert-content').text(msg);
    mod.modal();
    mod.find('button[name="focus"]').focus();
    setTimeout(function(){
        mod.modal('hide');
        if(callback) callback();
    },1000);
}
function messagealert(msg){
    var mod = $('#my-alert');
    var loginA = $('#my-login-a');
    loginA.hide();
    $('#my-alert-title').text('消息:');
    $('#my-alert-content').text(msg);
    mod.modal();
    mod.find('button[name="focus"]').focus();
}